﻿using System;
using EasyStep.Attributes;using EasyStep.TestExecution.Data;using EasyStep.TestExecution.Interfaces;

using OpenQA.Selenium;
using EasyStep.TestActions.Utils;


namespace EasyStep.TestActions.Actions.RandomFill
{
    [TestAction(typeof(RandomFill), Name = "ByClassName")]
    class RandomFillByClassName : ITestAction<IWebDriver>
    {
        public void Execute(IWebDriver browser, TestStepResult data, IExecuteDataContext context)
        {
            browser.FindElement(By.ClassName(data.Locator)).Clear();
            browser.FindElement(By.ClassName(data.Locator)).SendKeys(ActionUtils.RandomString(data.Data));
            
        }        
    }
}
